const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    list: [
      {
        name: "关于我们",
        id: "aboutus",
        page: "aboutus",
        icon: "about"
      },
      /* {
        name: "在线咨询",
        id: "setting",
        page: "setting",
        icon: "setting"
      }, */
      {
        name: "退出登录",
        id: "index",
        page: "index",
        icon: "setting2"
      }
    ]
  },
  listClick: function (e) {
    console.log(e)
    var curentId = e.currentTarget.dataset.id;
    console.log(curentId)
    if (curentId == "index") {
      wx.showModal({
        title: '提示',
        content: '请问确定要退出CTMS登录吗？',
        success: function (res) {
          if (res.confirm) {
            app.globalData.flag = true;
            wx.reLaunch({
              url: '../index/index',
            })
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })

    }
    else {
      wx.navigateTo({
        url: `../${curentId}/${curentId}`,
      })
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  }
})
